package T01_Student;

import java.util.ArrayList;

public class T03_StudentUtil {
    private T03_StudentUtil(){}

    /**
     * 获取列表中的最大值
     * @param list
     * @return
     */
    public static int getMaxAge(ArrayList<T01_Student> list){
        int age1 = list.get(0).getAge();

        for (int i = 0; i < list.size(); i++) {
            int thisAge = list.get(i).getAge();
            if(thisAge > age1){
                age1 = thisAge;
            }
        }
        return age1;
    }

}
